Skip to content

[codex] add Prompt Optimize market script#49

Draft
iron-water wants to merge 1 commit into
BigPizzaV3:mainfrom
iron-water:codex/add-prompt-optimize-script
Draft

[codex] add Prompt Optimize market script#49
iron-water wants to merge 1 commit into
BigPizzaV3:mainfrom
iron-water:codex/add-prompt-optimize-script

Conversation

@iron-water

Copy link
Copy Markdown

What changed

  • add scripts/prompt-optimize.js as the first formal Prompt Optimize market release
  • add the prompt-optimize v1.0.0 entry and SHA-256 to index.json
  • place a sparkle action to the left of the composer model selector, with optimize, cancel, restore, and editable style settings
  • support OpenAI Chat Completions-compatible and Anthropic Messages providers

Why

The original local prototype accumulated CDP sidecar, local CORS proxy, page-fetch, and pluggable transport fallbacks so it could work before the Codex++ executable exposed an LLM bridge. Those paths delayed every request, could retry the same prompt through multiple transports, and were not appropriate for a one-file market install.

This formal version targets the Codex++ distribution contract directly and uses only the built-in /llm-proxy bridge.

User and developer impact

  • market installation is a single self-contained JavaScript file; no Node sidecar or local proxy is required
  • requests use one deterministic transport and fail with an upgrade message when the host bridge route is unavailable
  • Base URLs must use HTTPS and cannot target localhost, private networks, or embed credentials
  • API keys remain local and are not returned by the public diagnostics API
  • delayed results cannot overwrite another thread or composer text that changed while the request was running
  • script reload now removes input listeners, and idle DOM maintenance avoids repeated full scans when the button is already placed correctly

Distribution dependency

This script is intended for a Codex++ release whose executable includes the /llm-proxy bridge route. The currently installed older release reports Unknown bridge path; the script maps that response to a clear upgrade error. Please merge/release the host bridge capability before marking this market entry generally available.

Validation

  • node --check scripts/prompt-optimize.js
  • parsed index.json, checked required fields and duplicate IDs, and verified the recorded SHA-256
  • verified no CDP sidecar, CORS proxy, page fetch, or pluggable transport residue remains
  • live Codex renderer injection: composer input found, placement valid, order reported as star-model-send
  • mocked formal bridge contract: OpenAI and Anthropic request construction and response parsing both passed
  • cargo test -p codex-plus-core llm_proxy against the distribution host source: passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant